<template>
  <div>
    <!-- 大标题 -->
    <h3 class="title">{{infoList.title}}</h3>
    <!-- 副标题 -->
    <p class="subtitle">
      <span>发表时间: {{infoList.add_time}}</span>
      <span>点击: {{infoList.click}}次</span>
    </p>
    <hr>
    <div class="content">{{infoList.content}}</div>

    <detail :id="this.id"></detail>
  </div>
</template>

<script>
import Detail from "./Detail"

export default {
  data: () => ({
    id: 0,
    infoList: {}
  }),
  created() {
    this.id = this.$route.params.id;
    this.getnew()
  },
  methods: {
    async getnew() {
      const {
        body: { status, message }
      } = await this.$http.get("api/getnew/" + this.id);
      console.log(message)
      if(status === 0){
      this.infoList=message
      }
    }
  },
  components:{
    Detail
  }
};
</script>

<style  scoped>
h3 {
  font-size: 18px;
  text-align: center;
}
textarea {
  width: 98%;
  font-size: 14px;
  height: 85px;
  margin: 0;
}
</style>